package apiday02homework01;

public class MathchesDemo {
    public static void main(String[] args) {
//        String email = "baibx@tude.cn";
//        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
//        boolean match= email.matches(regex);
//        if (match){
//            System.out.println("是正确的邮箱格式");
//        }else{
//            System.out.println("不是正确的邮箱格式");
//        }

//        String email = "baibx@tude.cn";
//        String regex = "[a-zA-Z0-9_]+@+[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
//        boolean match = email.matches(regex);
//        if (match){
//            System.out.println("是正确的邮箱格式");
//        }else{
//            System.out.println("不是正确的邮箱格式");
//        }

        String email = "baibx@tude.cn";
        String regex = "[a-zA-Z0-9_]+@+[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
        boolean match = email.matches(regex);
        if (match){
            System.out.println("正确的邮箱格式");
        }else {
            System.out.println("不是正确的邮箱格式");
        }
    }
}
